let t = require;
let  e = module
let  o =  e.exports;
 o.default =  e.exports;

                'use strict';
                console.log("start");
                var _n170,
                    i =
                    (this && this.__extends) ||
                    ((_n170 = function n(t, e) {
                            return (_n170 =
                                Object.setPrototypeOf ||
                                ({
                                        __proto__: []
                                    }
                                    instanceof Array &&
                                    function(t, e) {
                                        t.__proto__ = e;
                                    }) ||
                                function(t, e) {
                                    for (var o in e) {
                                        Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                                    }
                                })(t, e);
                        }),
                        function(t, e) {
                            function o() {
                                this.constructor = t;
                            }
                            _n170(t, e),
                                (t.prototype =
                                    null === e ?
                                    Object.create(e) :
                                    ((o.prototype = e.prototype), new o()));
                        });
                Object.defineProperty(o, '__esModule', {
                        value: !0
                    }),
                    (o.TalentInfo = o.TalentState = void 0);
                var r,
                    a = t('AbsInfo'),
                    s = t('MilitaryInfo');
                (function(t) {
                    (t[(t.Close = 0)] = 'Close'),
                    (t[(t.Open = 1)] = 'Open'),
                    (t[(t.Unlock = 2)] = 'Unlock');
                })((r = o.TalentState || (o.TalentState = {})));
                var c = (function(t) {
                    function e(e) {
                        var o = t.call(this) || this;
                        (o.root = o), (o._state = r.Close), (o._militarys = []);
                        for (var n = 0; n < e.length; n++) {
                            var i = new s.MilitaryInfo(e[n]);
                            (i.parent = o._militarys[n - 1]),
                            o._militarys.push(i),
                                i.on(a.InfoEvent.StateChanged, o.onItemUnlockHandler, o);
                        }
                        return o.build(), o;
                    }
                    return (
                        i(e, t),
                        (e.prototype.checkRedDotState = function(t) {
                            for (var e = !1, o = 0; o < this._militarys.length; o++) {
                                e || (e = this._militarys[o].checkRedDotState(t));
                            }
                            return e;
                        }),
                        Object.defineProperty(e.prototype, 'state', {
                            get: function get() {
                                return this._state;
                            },
                            set: function set(t) {
                                this._state = t;
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        (e.prototype.onItemUnlockHandler = function() {
                            for (var t = !0, e = 0; e < this._militarys.length; e++) {
                                t = t && this._militarys[e].isUnlock;
                            }
                            t && !this.isUnlock && this.unlock(), this.build();
                        }),
                        Object.defineProperty(e.prototype, 'isHave', {
                            get: function get() {
                                return this._isHave;
                            },
                            set: function set(t) {
                                if (this._isHave != t) {
                                    this._isHave = t;
                                    for (var e = 0; e < this._militarys.length; e++) {
                                        this._militarys[e].isHave = t;
                                    }
                                    this.emit(a.InfoEvent.StateChanged);
                                }
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        Object.defineProperty(e.prototype, 'type', {
                            get: function get() {
                                return this._militarys[0].type;
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        Object.defineProperty(e.prototype, 'level', {
                            get: function get() {
                                return this._militarys[0].level;
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        Object.defineProperty(e.prototype, 'isOpen', {
                            get: function get() {
                                return this._state == r.Open;
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        Object.defineProperty(e.prototype, 'isUnlock', {
                            get: function get() {
                                return this._state == r.Unlock;
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        (e.prototype.unlock = function() {
                            this.isHave &&
                                this.isOpen &&
                                !this.isUnlock &&
                                ((this._state = r.Unlock),
                                    this.emit(a.InfoEvent.StateChanged),
                                    this.child && this.child.open());
                        }),
                        (e.prototype.open = function() {
                            this.isOpen ||
                                ((this._state = r.Open),
                                    this._militarys[0].open(),
                                    this.emit(a.InfoEvent.StateChanged));
                        }),
                        Object.defineProperty(e.prototype, 'parent', {
                            get: function get() {
                                return this._parent;
                            },
                            set: function set(t) {
                                (this._parent = t),
                                t &&
                                    ((t.child = this),
                                        (this.root = t.root),
                                        t.isUnlock && this.open());
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        Object.defineProperty(e.prototype, 'militarys', {
                            get: function get() {
                                return this._militarys;
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        (e.prototype.onParentUnlockHandler = function() {
                            this.parent && (this.parent.targetOff(this), this.open());
                        }),
                        Object.defineProperty(e.prototype, 'child', {
                            get: function get() {
                                return this._child;
                            },
                            set: function set(t) {
                                this._child = t;
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        (e.prototype.getData = function() {
                            var t = {};
                            (t.isHave = this.isHave),
                            (t.state = this.state),
                            (t.militarys = []);
                            for (var e = 0; e < this._militarys.length; e++) {
                                t.militarys[e] = this._militarys[e].state;
                            }
                            return t;
                        }),
                        (e.prototype.setData = function(t) {
                            if (t) {
                                (this.state = t.state), (this.isHave = t.isHave);
                                for (var e = 0; e < this._militarys.length; e++) {
                                    this._militarys[e].state = t.militarys[e];
                                }
                                this.build();
                            }
                        }),
                        (e.prototype.build = function() {
                            (this._hp = 0),
                            (this._atk = 0),
                            (this._def = 0),
                            (this._crit = 0),
                            (this._solid = 0),
                            (this._hpPer = 0),
                            (this._atkPer = 0),
                            (this._defPer = 0);
                            for (var t = 0; t < this._militarys.length; t++) {
                                var e = this._militarys[t];
                                e.isUnlock &&
                                    ((this._hp += e.hp),
                                        (this._atk += e.atk),
                                        (this._def += e.def),
                                        (this._crit += e.crit),
                                        (this._solid += e.solid),
                                        (this._hpPer += e.hpPer),
                                        (this._atkPer += e.atkPer),
                                        (this._defPer += e.def));
                            }
                        }),
                        Object.defineProperty(e.prototype, 'hp', {
                            get: function get() {
                                return this._hp;
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        Object.defineProperty(e.prototype, 'atk', {
                            get: function get() {
                                return this._atk;
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        Object.defineProperty(e.prototype, 'def', {
                            get: function get() {
                                return this._def;
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        Object.defineProperty(e.prototype, 'crit', {
                            get: function get() {
                                return this._crit;
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        Object.defineProperty(e.prototype, 'solid', {
                            get: function get() {
                                return this._solid;
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        Object.defineProperty(e.prototype, 'hpPer', {
                            get: function get() {
                                return this._hpPer;
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        Object.defineProperty(e.prototype, 'atkPer', {
                            get: function get() {
                                return this._atkPer;
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        Object.defineProperty(e.prototype, 'defPer', {
                            get: function get() {
                                return this._defPer;
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        e
                    );
                })(a.default);
                (o.TalentInfo = c), console.log("end");
            module.exports =  e.exports;